import 'package:json_annotation/json_annotation.dart';
import 'dart:convert';

part 'app_version_entity.g.dart';

@JsonSerializable()
class AppVersionEntity {
  String? msg;
  int? code;
  AppVersionData? data;

  AppVersionEntity({this.msg, this.code, this.data});

  factory AppVersionEntity.fromJson(Map<String, dynamic> json) =>
      _$AppVersionEntityFromJson(json);

  Map<String, dynamic> toJson() => _$AppVersionEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class AppVersionData {
  String? createTime;
  String? updateTime;
  String? remark;
  AppVersionDataParams? params;
  int? id;
  String? version;
  int? platform;
  String? downUrl;
  String? describe;
  int? mustRenew;

  AppVersionData({
    this.createTime,
    this.updateTime,
    this.remark,
    this.params,
    this.id,
    this.version,
    this.platform,
    this.downUrl,
    this.describe,
    this.mustRenew,
  });

  factory AppVersionData.fromJson(Map<String, dynamic> json) =>
      _$AppVersionDataFromJson(json);

  Map<String, dynamic> toJson() => _$AppVersionDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class AppVersionDataParams {
  AppVersionDataParams();

  factory AppVersionDataParams.fromJson(Map<String, dynamic> json) =>
      _$AppVersionDataParamsFromJson(json);

  Map<String, dynamic> toJson() => _$AppVersionDataParamsToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
